<%--
  Created by IntelliJ IDEA.
  User: zoud
  Date: 28/09/2016
  Time: 19:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Database Commons - Create database</title>
    <script>
        $(document).ready(function () {
            $('.plus.icon.link.organism').click(function (e) {
                e.preventDefault();
                $('#osm').append('<div class="ui input icon can-remove"><input name="organism" placeholder="Organism name"/><i class="trash link icon" ></i></div>');
            });

            $(document).on('click', '.trash.link.icon', function (e) {
                e.preventDefault();
                $(this).parent().remove();
            });

            $('.plus.icon.link.datetype').click(function (e) {
                e.preventDefault();
                $('#dt').append('<div class="ui input icon can-remove"><input name="datatype" placeholder="Date type name"/><i class="trash link icon" ></i></div>');
            });

            $(document).on('click', '.trash.link.icon', function (e) {
                e.preventDefault();
                $(this).parent().remove();
            });

            $('.plus.icon.link.keyword').click(function (e) {
                e.preventDefault();
                $('#kw').append('<div class="ui input icon can-remove"><input name="keyword" placeholder="Keyword"/><i class="trash link icon" ></i></div>');
            });

            $(document).on('click', '.trash.link.icon', function (e) {
                e.preventDefault();
                $(this).parent().remove();
            });
        });
    </script>
</head>

<body>
<div class="ui segment basic">
    <h1 class="ui header">New database</h1>
    <div class="sub header text red">Notes: Please write below information carefully, this is very important!
    </div>
    <div class="ui massive steps">
        <div class="step">
            <i class="info icon"></i>
            <div class="content">
                <div class="title">Basic information</div>
            </div>
        </div>
        <div class="step active">
            <i class="tasks icon"></i>
            <div class="content">
                <div class="title red">Data information</div>
            </div>
        </div>
        <div class="step">
            <i class="mail icon"></i>
            <div class="content">
                <div class="title">Contact information</div>
            </div>
        </div>
        <div class="step">
            <i class="book icon"></i>
            <div class="content">
                <div class="title">Publication information</div>
            </div>
        </div>
    </div>
    <br/>
    <div class="ui grid horizontal segments">
        <div class="ui thirteen wide column segment">
            <form class="ui form" method="post" action="${host}/user/db/update">
                <div class="two fields">
                    <div class="field">
                        <label class="text red">Date type * </label>
                        <div class="ui input icon">
                            <input name="datatype" placeholder="Data type name"/><i
                                class="plus icon link datetype"></i>
                        </div>
                        <div id="dt"></div>
                    </div>
                    <div class="field">
                        <label class="text red">Organism * </label>
                        <div class="ui input icon">
                            <input name="organism" placeholder="Organism name"/><i class="plus icon link organism"></i>
                        </div>
                        <div id="osm"></div>
                    </div>
                    <div class="field">
                        <label class="text red">Keyword * </label>
                        <div class="ui input icon">
                            <input name="keyword" placeholder="Keyword"/><i class="plus icon link keyword"></i>
                        </div>
                        <div id="kw"></div>
                    </div>
                </div>
                <div class="field">
                    <input type="hidden" value="${session.currentUser.id}" name="id"/>
                    <button type="submit" class="ui button green">Submit<i class="arrow circle outline right icon"></i>&nbsp;&nbsp;&nbsp;Next step
                    </button>
                </div>
            </form>
        </div>
        <div class="ui segment three wide column">
            <h3 class="ui header">Help</h3>
            <p class="text justified"></p>
        </div>
    </div>
</div>
</body>
</html>
